<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
<script language="JavaScript">

document.write('reverse()方法');
document.write('<br />');
document.write('/颠倒顺序/');
document.write('<br />');
var arr=new Array(1,2,3,4,5,6);
document.write('原数组:'+arr+'<br />');
arr.reverse();
document.write('颠倒后的数组:'+arr);


document.write('<br />');
document.write('<br />');


document.write('sort()方法');
document.write('<br />');
document.write('/排列顺序/');
document.write('<br />');
var arr=new Array(2,1,4,3,6,5);
document.write('原数组:'+arr+'<br />');
arr.sort();
document.write('排序后的数组:'+arr);

document.write('<br />');
document.write('<br />');
var arr=new Array("a","b","c","d","e","f");
document.write("原数组:"+arr+"<br />");
document.write("获取数组中第4个元素后的所有元素："+arr.slice(3)+"<br />");
document.write("获取数组中第3个到："+arr.slice(2,5)+"<br />");
document.write("获取数组中倒数第3个元素后的所有元素"+arr.slice(-3));



</script>
	</body>
</html>
